using Baik.Interface.Execution;
using Baik.Interface.Expression;
using Baik.Interface.Framework;

namespace Baik.Expression
{
    public class StringLiteral : Expression, IStringLiteral
    {
        public StringLiteral(IInjector inject) : base(inject)
        {
        }

        public override IObject Evaluate()
        {
            var rtn = Inject.Instantiate<IString>();
            rtn.Value = Value.Substring(1, Value.Length -2);
            return rtn;
        }

        public string AsString()
        {
            return "'" + Value + "'";
        }
        public string Value { get; set; }
    }
}